package org.jeecg.modules.tea_stu_course.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.common.system.base.entity.SysUserTit;
import org.jeecg.modules.tea_stu_course.entity.AstuTeastuCourse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * @Description: 老师学生课程交汇表
 * @Author: jeecg-boot
 * @Date:   2021-10-12
 * @Version: V1.0
 */
public interface AstuTeastuCourseMapper extends BaseMapper<AstuTeastuCourse> {
    //通过username 查询用户
    public SysUserTit selectUser(@Param("username") String username);
    //通过学号，教师号，课程号 查询数据
    @Select("SELECT * From astu_teastu_course WHERE student_number=#{studentNumber} AND teacher_number=#{teacherNumber} AND course_id=#{courseId}")
    AstuTeastuCourse selectAstuTeastuCourseByStudentNumberAndteacherNumberAndCourseId(@Param("studentNumber") String studentNumber,@Param("teacherNumber") String teacherNumber,@Param("courseId") String courseId);

    //通过账号得到学科信息
    List<AstuTeastuCourse> selectInfoByNum(@Param("studentNumber") String studentNumber);

    /**
     * 通过学生学号和课程号查询选课信息
     * @param studentNumber
     * @param courseNumber
     * @return
     */
    AstuTeastuCourse selectinfoByStuNumAndCourseNum(@Param("studentNumber") String studentNumber,@Param("courseNumber") String courseNumber);
}
